package com.microinvest.controller.stock;
import com.alibaba.fastjson.JSON;
import com.microinvest.entity.Users;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "q_test_01")
public class Listener {

    @RabbitHandler
    public void process(String hello) {
        Users users= JSON.parseObject(hello, Users.class);
        System.out.println("Receiver2  : " + users.getUserName());
    }

}
